import redis
from flask import Flask, render_template,jsonify
import time

r = redis.StrictRedis(host="192.168.52.140", port=6379, db=0, decode_responses=True)
def get_zong_data():
    res1 = []
    res2 = []
    data = r.zrevrange('BookTop', 0, 10, withscores=True)
    l = len(data)-1
    i = 0
    while (l):
        if (data[i][0] != " "):
            res1.append(data[i][0])
            res2.append(data[i][1])
            i = i + 1
            l = l - 1
        else:
            i = i + 1
    # print({"type_list":type_list,"value_list":value_list})
    return res1


if __name__ == '__main__':
    print(get_zong_data())